/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tmp.ac.ui.setting;

import ac.uitls.propertiesOperation;
import tmp.ac.lib.tools.uiUtil;

/**
 *
 * @author ismail
 */
public class genSetting extends javax.swing.JPanel {

    /**
     * Creates new form genSetting
     */
    uiUtil u = new uiUtil();
        propertiesOperation po = new propertiesOperation();
    tmp.ac.engin.setting.genSetting gs = new tmp.ac.engin.setting.genSetting();
    tmp.ac.lib.tools.uiUtil UIU = new tmp.ac.lib.tools.uiUtil();

    public genSetting() {
        initComponents();
        u.updatepanelWords(this.getComponents());


        //  

        lang_cb.setSelectedItem(gs.getGenSetting()[0]);

    }

  
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jToolBar2 = new javax.swing.JToolBar();
        update_bt = new javax.swing.JButton();
        default_bt = new javax.swing.JButton();
        lang_lb = new javax.swing.JLabel();
        lang_cb = new javax.swing.JComboBox();
        style_lb = new javax.swing.JLabel();
        style_cb = new javax.swing.JComboBox();

        jLabel1.setText("jLabel1");

        jToolBar2.setRollover(true);

        update_bt.setText("update_bt");
        update_bt.setFocusable(false);
        update_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        update_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        update_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                update_btActionPerformed(evt);
            }
        });
        jToolBar2.add(update_bt);

        default_bt.setText("default_bt");
        default_bt.setFocusable(false);
        default_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        default_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        default_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                default_btActionPerformed(evt);
            }
        });
        jToolBar2.add(default_bt);

        lang_lb.setText("lang_lb");

        lang_cb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "ar", "en", " " }));

        style_lb.setText("style_lb");

        style_cb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "default" }));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar2, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lang_lb)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lang_cb, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(style_lb)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(style_cb, 0, 346, Short.MAX_VALUE)
                        .addGap(3, 3, 3))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lang_cb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lang_lb))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(style_lb)
                    .addComponent(style_cb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(200, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void update_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_update_btActionPerformed
        // TODO add your handling code here:
        String[] items = {(String) lang_cb.getSelectedItem(),(String) style_cb.getSelectedItem()};
        UIU.sendMessage(this, po.getWord("label.saveUpdate"),gs.updateSetting(items));
    }//GEN-LAST:event_update_btActionPerformed

    private void default_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_default_btActionPerformed
        // TODO add your handling code here:
        UIU.sendMessage(this, po.getWord("label.saveUpdate"),gs.defSetting());
    }//GEN-LAST:event_default_btActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton default_bt;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JComboBox lang_cb;
    private javax.swing.JLabel lang_lb;
    private javax.swing.JComboBox style_cb;
    private javax.swing.JLabel style_lb;
    private javax.swing.JButton update_bt;
    // End of variables declaration//GEN-END:variables
}
